<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>ColumNav example: content loaded from a JSON object literal</title>
    <script type="text/javascript" src="../js/yui//utilities.js"></script>
    <script type="text/javascript" src="../js/yui/container_core-min.js"></script>
    <script type="text/javascript" src="../js/carousel_min.js"></script>
    <script type="text/javascript" src="../js/json.js"></script>
    <script type="text/javascript" src="../js/columnav_min.js"></script>
    <link href="../css/examples.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript">
      try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
      var json = { "ul": {
          "li": [
              { "a": { "@href": "http://sports.yahoo.com/nba/", "#text": "NBA" } },
              { "a": { "@href": "ajax/json/ncaa/index.json", "@rel": "ajax", "#text": "NCAA" } }
          ]
      } };
      function init() {
          var cn_cfg = { prevElement: 'columnav-prev', datasource: json }
          var cn = new YAHOO.extension.ColumNav('columnav', cn_cfg);

          var sv_cfg = { url: location.href, modifier: 'HTML' };
          var sv = new YAHOO.extension.SourceViewer('source', sv_cfg);
      }
      YAHOO.util.Event.addListener(window, 'load', init);
    </script>
    <script type="text/javascript" src="../js/viewsource.js"></script>
    <link href="../css/stringify.css" rel="stylesheet" type="text/css"/>
  </head>
  <body>
    <div id="main">
      <div id="content">
        <p style="float:right"><a href="../">Documentation</a></p>
        <h1>ColumNav</h1>
        <h2>Example</h2>
        <div class="prevButton">
          <a href="javascript:void(0)" id="columnav-prev">&lt; back</a>
        </div>
        <div id="columnav" class="carousel-component">
          <div class="carousel-clip-region">
            <ul class="carousel-list"></ul>
          </div>
        </div>
        <div class="viewsource" id="source"></div>
        <p>The ColumNav above is initialized from a manually constructed JSON object. The items initially visible on page load are the only ones required to instantiate a ColumNav object. Sub-menus can be loaded using Ajax requests by specifying <code>"@rel": "ajax"</code> in the leaf object, and providing a <code>@href</code> URL pointing to another data source.</p>
      </div>
    </div>
  </body>
</html>
